<?php

class CLog extends Base{
	
	public static function write($message,$level = 'Error',$file) {
		$file	= LOG_DIR . '/' . $file . '.log';
		$logDir = dirname($file);
		if(!is_dir($logDir)) {
			mkdir($logDir,0777,true);
		} else {
			chmod($logDir,0777);
		}
		error_log(date('[Y-m-d H:i:s]') . " {$level}: {$message} IP: {$_SERVER['REMOTE_ADDR']}\r\n", 3, $logFileName);
	}
}